import { useRouteError } from 'react-router-dom'
import './style.css'

const ErrorPage = () => {
	const error = useRouteError() as { statusText?: string; message?: string }
	console.debug('error:', error)

	return (
		<div className='errorPage'>
			<h1>出错了!</h1>
			<p>您访问的页面遇到了错误.</p>
			<p>错误信息:{error?.statusText || error?.message || 'Not Found'}</p>
		</div>
	)
}

export default ErrorPage
